package com.opt.sample;

import java.util.ArrayList;
import java.util.List;

public class NewPopulation {

	public List<NewTask> tasks = new ArrayList<NewTask>();

	public List<NewTask> getTasks() {
		return tasks;
	}

	public void addTasks(NewTask task) {
		this.tasks.add(task);
	}

	public void setTasks(List<NewTask> newTaskList) {
		this.tasks = newTaskList;
	}

	public String toString() {
		StringBuilder population = new StringBuilder();

		for (NewTask task : tasks) {
			for (NewPackage newPackage : task.getCandidates()) {

				population.append(newPackage.getCandCity() + "||"
						+ newPackage.getCandPriority() + "||"
						+ newPackage.getCandProfit());

			}
		}

		return population.toString();
	}

}
